import { dealValueIsRight } from '@/pages/commodity/modules/utils/salePriceRequireUtils'
import { generateHighlightNodeForSalePrice } from '@/utils/bizUtils';
export const salePriceMultipleColumns = [
  {
    title: 'SKU编码',
    key: 'skuNo',
    fixed: 'left'
  },
  {
    title: '商品名称',
    key: 'productName',
    fixed: 'left'
  },
  {
    title: '规格',
    key: 'spec',
    fixed: 'left'
  },
  {
    title: '价格组',
    key: 'groupName',
    fixed: 'left'
  },
  {
    title: '城市',
    key: 'cityName',
  },
  {
    title: '业务区域',
    key: 'businessArea',
  },
  {
    title: '是否敏感',
    key: 'isPriceSensitive',
    formatter: (row, columns, cellValue) => {
      return cellValue === '1' ? '是' : '否';
    },
  },
  {
    title: '商品管理区域',
    key: 'saleAreaName',
  },
  {
    title: '供货计量单位',
    key: 'supplyUnit',
  },
  {
    title: '主计量单位',
    key: 'mainUnit',
  },
  {
    title: '理论转换率',
    key: 'theoryConverRate',
    render: (h, { row }) => {
      return (<span>{ dealValueIsRight(row.nowInput.theoryConverRate) }</span>)
    }
  },
  {
    title: '实际转换率',
    key: 'realConverRate',
    render: (h, { row }) => {
      return (<span>{ dealValueIsRight(row.nowInput.realConverRate) }</span>)
    }
  },
  {
    title: '异常转换率',
    key: 'exConverRate',
    render: (h, { row }) => {
      return (<span>{ dealValueIsRight(row.nowInput.exConverRate) }</span>)
    }
  },
  {
    title: '售价类型',
    key: 'saleType',
    render: (h, { row }) => {
      let saleTypeStr = row.nowInput.saleType === '1' ? '统一售价' : '区域售价'
      return (<span>{ saleTypeStr }</span>)
    },
  },
  {
    title: '实际转换率辅计量成本价',
    key: 'realBackUnitPrice',
    render: (h, { row }) => {
      return (<span>{ dealValueIsRight(row.nowInput.realBackUnitPrice) }</span>)
    }
  },
  {
    title: '理论转换率辅计量成本价',
    key: 'theoryBackUnitPrice',
    render: (h, { row }) => {
      return (<span>{ dealValueIsRight(row.nowInput.theoryBackUnitPrice) }</span>)
    }
  },
  {
    title: '主计量成本价',
    key: 'mainUnitPrice',
    render: (h, { row }) => {
      return (<span>{ dealValueIsRight(row.nowInput.mainUnitPrice) }</span>)
    }
  },
  {
    title: '加价类型',
    children: [{
      title: '原值',
      key: 'oldAddPriceTypeName',
      render: (h, { row }) => {
        return (<span>{ row.oldInput.addPriceTypeName }</span>)
      }
    },
    {
      title: '现值',
      key: 'nowAddPriceTypeName',
      render: (h, { row }) => {
        return generateHighlightNodeForSalePrice(h, row.oldInput.addPriceTypeName, row.nowInput.addPriceTypeName)
      }
    }]
  },
  {
    title: '销售面价',
    children: [{
      title: '原值',
      key: 'oldFacePrice2',
      render: (h, { row }) => {
        return (<span>{ dealValueIsRight(row.oldInput.facePrice2) }</span>)
      }
    },
    {
      title: '现值',
      key: 'facePrice2',
      render: (h, { row }) => {
        return generateHighlightNodeForSalePrice(h, row.oldInput.facePrice2, row.nowInput.facePrice2)
      }
    }]
  },
  {
    title: '现金价标准加价率/金额',
    children: [{
      title: '原值',
      key: 'oldcashAddRateOrMoney',
      render: (h, { row }) => {
        return (<span>{ dealValueIsRight(row.oldInput.cashAddRateOrMoney) }</span>)
      }
    },
    {
      title: '现值',
      key: 'cashAddRateOrMoney',
      render: (h, { row }) => {
        return generateHighlightNodeForSalePrice(h, row.oldInput.cashAddRateOrMoney, row.nowInput.cashAddRateOrMoney)
      }
    }]
  },
  {
    title: '辅计量现金价',
    children: [{
      title: '原值',
      key: 'oldBackUnitCashPrice',
      render: (h, { row }) => {
        return (<span>{ dealValueIsRight(row.oldInput.backUnitCashPrice) }</span>)
      }
    },
    {
      title: '现值',
      key: 'nowBackUnitCashPrice',
      render: (h, { row }) => {
        return generateHighlightNodeForSalePrice(h, row.oldInput.backUnitCashPrice, row.nowInput.backUnitCashPrice)
      }
    }]
  },
  {
    title: '主计量现金价',
    children: [{
      title: '原值',
      key: 'oldMainUnitCashPrice',
      render: (h, { row }) => {
        return (<span>{ dealValueIsRight(row.oldInput.mainUnitCashPrice) }</span>)
      }
    },
    {
      title: '现值',
      key: 'nowMainUnitCashPrice',
      render: (h, { row }) => {
        return generateHighlightNodeForSalePrice(h, row.oldInput.mainUnitCashPrice, row.nowInput.mainUnitCashPrice)
      }
    },
    {
      title: '浮动率',
      key: 'cashFloatRate',
    }]
  },
  {
    title: '分销与现金差额/差率',
    children: [{
      title: '原值',
      key: 'oldDistribCashDiffRateOrMoney',
      render: (h, { row }) => {
        return (<span>{ dealValueIsRight(row.oldInput.distribCashDiffRateOrMoney) }</span>)
      }
    },
    {
      title: '现值',
      key: 'distribCashDiffRateOrMoney',
      render: (h, { row }) => {
        return generateHighlightNodeForSalePrice(h, row.oldInput.distribCashDiffRateOrMoney, row.nowInput.distribCashDiffRateOrMoney)
      }
    }]
  },
  {
    title: '辅计量分销价',
    children: [{
      title: '原值',
      key: 'oldBackUnitDistribPrice',
      render: (h, { row }) => {
        return (<span>{ dealValueIsRight(row.oldInput.backUnitDistribPrice) }</span>)
      }
    },
    {
      title: '现值',
      key: 'nowBackUnitDistribPrice',
      render: (h, { row }) => {
        return generateHighlightNodeForSalePrice(h, row.oldInput.backUnitDistribPrice, row.nowInput.backUnitDistribPrice)
      }
    }]
  },
  {
    title: '主计量分销价',
    children: [{
      title: '原值',
      key: 'old_mainUnitDistribPrice',
      render: (h, { row }) => {
        return (<span>{ dealValueIsRight(row.oldInput.mainUnitDistribPrice) }</span>)
      }
    },
    {
      title: '现值',
      key: 'now_mainUnitDistribPrice',
      render: (h, { row }) => {
        return generateHighlightNodeForSalePrice(h, row.oldInput.mainUnitDistribPrice, row.nowInput.mainUnitDistribPrice)
      }
    },
    {
      title: '浮动率',
      key: 'distribFloatRate',
    }]
  },
  {
    title: '售价标准加价率/金额',
    children: [{
      title: '原值',
      key: 'oldSaleAddRateOrMoney',
      render: (h, { row }) => {
        return (<span>{ dealValueIsRight(row.oldInput.saleAddRateOrMoney) }</span>)
      }
    },
    {
      title: '现值',
      key: 'saleAddRateOrMoney',
      render: (h, { row }) => {
        return generateHighlightNodeForSalePrice(h, row.oldInput.saleAddRateOrMoney, row.nowInput.saleAddRateOrMoney)
      }
    }]
  },
  {
    title: '辅计量售价',
    children: [{
      title: '原值',
      key: 'oldBackUnitSalePrice',
      render: (h, { row }) => {
        return (<span>{ dealValueIsRight(row.oldInput.backUnitSalePrice) }</span>)
      }
    },
    {
      title: '现值',
      key: 'nowBackUnitSalePrice',
      render: (h, { row }) => {
        return generateHighlightNodeForSalePrice(h, row.oldInput.backUnitSalePrice, row.nowInput.backUnitSalePrice)
      }
    }]
  },
  {
    title: '主计量售价',
    children: [{
      title: '原值',
      key: 'oldMainUnitSalePrice',
      render: (h, { row }) => {
        return (<span>{ dealValueIsRight(row.oldInput.mainUnitSalePrice) }</span>)
      }
    },
    {
      title: '现值',
      key: 'nowMainUnitSalePrice',
      render: (h, { row }) => {
        return generateHighlightNodeForSalePrice(h, row.oldInput.mainUnitSalePrice, row.nowInput.mainUnitSalePrice)
      }
    },
    {
      title: '浮动率',
      key: 'saleFloatRate',
    }]
  },
  {
    title: '现金辅计量批量加价金额/比例',
    children: [{
      title: '原值',
      key: 'oldCashBackUnitAddRateOrMoney',
      render: (h, { row }) => {
        return (<span>{ dealValueIsRight(row.oldInput.cashBackUnitAddRateOrMoney) }</span>)
      }
    },
    {
      title: '现值',
      key: 'cashBackUnitAddRateOrMoney',
      render: (h, { row }) => {
        return generateHighlightNodeForSalePrice(h, row.oldInput.cashBackUnitAddRateOrMoney, row.nowInput.cashBackUnitAddRateOrMoney)
      }
    }]
  },
  {
    title: '现金辅计量批量价',
    children: [{
      title: '原值',
      key: 'oldCashBackUnitBatchPrice',
      render: (h, { row }) => {
        return (<span>{ dealValueIsRight(row.oldInput.cashBackUnitBatchPrice) }</span>)
      }
    },
    {
      title: '现值',
      key: 'nowCashBackUnitBatchPrice',
      render: (h, { row }) => {
        return generateHighlightNodeForSalePrice(h, row.oldInput.cashBackUnitBatchPrice, row.nowInput.cashBackUnitBatchPrice)
      }
    }]
  },
  {
    title: '辅计量批量售价加价金额/比例',
    children: [{
      title: '原值',
      key: 'oldSaleBackUnitAddRateOrMoney',
      render: (h, { row }) => {
        return (<span>{ dealValueIsRight(row.oldInput.saleBackUnitAddRateOrMoney) }</span>)
      }
    },
    {
      title: '现值',
      key: 'saleBackUnitAddRateOrMoney',
      render: (h, { row }) => {
        return generateHighlightNodeForSalePrice(h, row.oldInput.saleBackUnitAddRateOrMoney, row.nowInput.saleBackUnitAddRateOrMoney)
      }
    }]
  },
  {
    title: '售价辅计量批量价',
    children: [{
      title: '原值',
      key: 'oldSaleBackUnitBatchPrice',
      render: (h, { row }) => {
        return (<span>{ dealValueIsRight(row.oldInput.saleBackUnitBatchPrice) }</span>)
      }
    },
    {
      title: '现值',
      key: 'nowSaleBackUnitBatchPrice',
      render: (h, { row }) => {
        return generateHighlightNodeForSalePrice(h, row.oldInput.saleBackUnitBatchPrice, row.nowInput.saleBackUnitBatchPrice)
      }
    }]
  },
  {
    title: '限制展示价',
    children: [{
      title: '原值',
      key: 'oldlimitShowPrice',
      render: (h, { row }) => {
        return (<span>{ dealValueIsRight(row.oldInput.limitShowPrice) }</span>)
      }
    },
    {
      title: '现值',
      key: 'limitShowPrice',
      render: (h, { row }) => {
        return generateHighlightNodeForSalePrice(h, row.oldInput.limitShowPrice, row.nowInput.limitShowPrice)
      }
    }]
  },
  {
    title: '限制交易价',
    children: [{
      title: '原值',
      key: 'oldlimitTradePrice',
      render: (h, { row }) => {
        return (<span>{ dealValueIsRight(row.oldInput.limitTradePrice) }</span>)
      }
    },
    {
      title: '现值',
      key: 'limitTradePrice',
      render: (h, { row }) => {
        return generateHighlightNodeForSalePrice(h, row.oldInput.limitTradePrice, row.nowInput.limitTradePrice)
      }
    }]
  }
]
